import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 账号监测列表
export function getAccountsList(params) {
  return request({
    url: 'admin/accounts/list',
    method: 'get',
    params
  });
}

// 添加账号
export function addAccount(data) {
  return request({
    url: 'admin/accounts/add',
    method: 'post',
    data
  });
}

// 监测设置
export function setMonitoring(data) {
  return request({
    url: 'admin/accounts/monitor/edit',
    method: 'post',
    data
  });
}

// 删除账号
export function deleteAccount(params) {
  return request({
    url: 'admin/accounts/delete',
    method: 'delete',
    params
  });
}

// 运营人员设置
export function setOperators(data) {
  return request({
    url: 'admin/accounts/setOperators',
    method: 'post',
    data
  });
}

// 微博账号采集数量
export function getWeiboNum(params) {
  return request({
    url: 'admin/accounts/weiboNum',
    method: 'get',
    params
  });
}

// 微博列表
export function getWeiboList(params) {
  return request({
    url: 'admin/weibo/list',
    method: 'get',
    params
  });
}

// 微博处理
export function processWeibo(params) {
  return request({
    url: 'admin/weibo/edit',
    method: 'put',
    params
  });
}

// 停止采集
export function stopPicking(params) {
  return request({
    url: 'admin/weibo/stop',
    method: 'put',
    params
  });
}

// 账号详情
export function getAccountDetail(id) {
  return request({
    url: `admin/accounts/detail/info/${id}`,
    method: 'get'
  });
}

// 获取默认健康值
export function getDefaultHealthValue() {
  return request({
    url: 'admin/accounts/defaultHealth',
    method: 'get'
  });
}

// 设置默认健康值
export function setDefaultHealthValue(data) {
  return request({
    url: 'admin/accounts/defaultHealth/edit',
    method: 'post',
    data
  });
}

// 设置健康值
export function setHealthValue(data) {
  return request({
    url: 'admin/accounts/health/edit',
    method: 'post',
    data
  });
}

// 监测数据
export function getMonitoringData(params) {
  return request({
    url: 'admin/weibo/data',
    method: 'get',
    params
  });
}

// 微博统计数据
export function getWeiboStatistics(params) {
  return request({
    url: 'admin/weibo/statistics',
    method: 'get',
    params
  });
}

export function editAccountStatus(data) {
  return request({
    url: 'admin/accounts/status/edit',
    method: 'put',
    data
  });
}

export function editAccountCollection(data) {
  return request({
    url: 'admin/accounts/collection/edit',
    method: 'put',
    data
  });
}

export function getAccountCollection() {
  return request({
    url: 'admin/accounts/collection',
    method: 'get'
  });
}

export function setNotifyRule(data) {
  return request({
    url: 'admin/accounts/notifyRule',
    method: 'post',
    data
  });
}
